#ifndef _socket_class
#define _socket_class

#include <winsock2.h>
#include <string>
#include <ws2tcpip.h>

using namespace std;

const int MAXHOSTNAME = 200;
const int MAXCONNECTIONS = 5;
const int MAXRECV = 32;


class Socket
{
public:
	Socket();
	virtual ~Socket();

	bool Create();

	bool Connect(const string host, const string port);

	bool Send(const string) const;
	int Recv(string&) const;

//	void set_non_blocking(const bool);
	
	bool Is_valid() const { return m_sock != -1; }

private:
	SOCKET sock;
	int m_sock;
	sockaddr_in addr;
	struct addrinfo *result, *ptr, hints;

};

#endif

